import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

import ErrorRoute from '@/views/errors/route'
import StartRoute from '@/views/start/route'
import MainRoute from '@/views/main/route'
import FilmRoute from '@/views/film/route'
import GoodRoute from '@/views/good/route'
const routes = [
  {
    path: "/",
    redirect: '/guide'
  },
  {
    path: '/guide',
    name: 'guide',
    component: () => import('@/views/guide/guide.vue')
  },
  ...ErrorRoute,
  ...StartRoute,
  ...MainRoute,
  ...FilmRoute,
  ...GoodRoute,
  {
    path: '/search',
    name: 'search',
    component: () => import('@/views/search/search.vue')
  },
  {
    path: '/photo',
    name: 'photo',
    component: () => import('@/views/photo/photo.vue')
  },
  {
    path: "*",
    redirect: {
      name: "notfound"
    }
  }
]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router
